#include <iostream>

void solve_problem_232()
{
#if 0
	const int N = 1;
#else
	const int N = 100;
#endif

	double q[N+1][N+1];
	int T[N][N];
	for (int b = 0; b < N; b++)
		q[N][b] = 0.0;
	for (int a = 0; a <= N; a++)
		q[a][N] = 1.0;

	for (int a = N-1; a >= 0; a--)
	{
		for (int b = N-1; b >= 0; b--)
		{
			double qmax = 0.0;
			int kmax = 0;
			for (int k = 1; ; k++)
			{
				int bb = std::min(N, b + (1 << (k - 1)));
				double qq = (q[a+1][bb] + q[a][bb] + ((1<<k)-1)*q[a+1][b]) / ((1<<k)+1);
				if (qq > qmax)
				{
					qmax = qq;
					kmax = k;
				}
				if (bb >= N)
					break;
			}
			q[a][b] = qmax;
			T[a][b] = kmax;
		}
	}

	std::cout.precision(8);
	std::cout << std::fixed << (q[0][0] + q[1][0]) / 2.0 << std::endl;
}